Non-volatile data storage devices, such as universal serial bus (USB) flash memory devices or removable storage cards, have allowed for increased portability of data and software applications. Such devices may enable data to be stored by a host device and later retrieved from a memory in the data storage device. For example, a host device may send a write command to a data storage device and specify a memory address. The data storage device may store data to a memory location indicated by the memory address.
When a write command is received from a host device, the data storage device may be responsible for ensuring that write-protected data stored in the memory is not overwritten by the host device. The data storage device may maintain a write protection map that identifies whether write protection is enabled for each memory address that maps to a location in the memory. For example, a write protection map may have a write protection indicator for each group of memory addresses, such as sector-sized groups (e.g., 512 bytes), page-sized groups (e.g., 2 kilobytes), or other-sized groups of memory addresses. Starting at the address provided by the host device, the data storage device may “walk” through the write protection map, in response to receiving a write command, to identify a total amount of sequentially addressed space that is not write-protected to determine a largest amount of data that may be stored in response to the write command.
However, because memory capacity increases with advances in storage technologies, a size of the write protection map may also increase. An amount of time expended walking through the write protection map creates write latency experienced by the host device. For example, when a first address following the write address is write protected, the write protection map search may be completed in a few microseconds. However, when the write address is near a beginning of an address space and a first address of write protected data is near an end of the address space, the write protection map search may take tens of microseconds to complete.